package org.edu.dao.impl;

import java.util.List;

import org.edu.dao.TeacherDao;
import org.edu.model.Teacher;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class TeacherDaoImpl implements TeacherDao {

	@Autowired
	private SessionFactory sessionFactory;

	public TeacherDaoImpl() {
	}

	@Override
	public List<Teacher> teachers() {
		return sessionFactory.getCurrentSession().createQuery("from Teacher").list();
	}

}
